using FireStarterModeller.BO;
using Habanero.Base;
using Habanero.BO.ClassDefinition;
using Habanero.Testability;

namespace FireStarterModeller.Test
{
    public class TestUtilsDMInheritanceRelationship
    {

        public static BOTestFactory<DMInheritanceRelationship> GetFactory()
        {
            return BOTestFactoryRegistry.Instance.Resolve<DMInheritanceRelationship>();
        }
        /// <summary>
        /// Creates a new saved DMInheritanceRelationship with a random value assigned to every property
        /// </summary>
        public static DMInheritanceRelationship CreateSavedDMInheritanceRelationship()
        {
            DMInheritanceRelationship dMInheritanceRelationship = CreateUnsavedValidDMInheritanceRelationship();
            dMInheritanceRelationship.Save();
            return dMInheritanceRelationship;
        }

        /// <summary>
        /// Creates a new unsaved DMInheritanceRelationship with a random value assigned to every property
        /// </summary>
        public static DMInheritanceRelationship CreateUnsavedValidDMInheritanceRelationship()
        {
            DMSolution dmSolution = TestUtilsShared.CreateUnsavedValidDMSolution();
            DMInheritanceRelationship dMInheritanceRelationship = new DMInheritanceRelationship();
            dMInheritanceRelationship.SuperClass = TestUtilsShared.CreateUnsavedValidDMClass(dmSolution);
            dMInheritanceRelationship.SubClass = TestUtilsShared.CreateUnsavedValidDMClass(dmSolution);
            dMInheritanceRelationship.Identity = TestUtilsShared.GetRandomString();
            dMInheritanceRelationship.CreateDiscriminator();
            dMInheritanceRelationship.Generated = TestUtilsShared.GetRandomBoolean();
            dMInheritanceRelationship.InheritanceType = ORMapping.SingleTableInheritance;
            return dMInheritanceRelationship;
        }

        /// <summary>
        /// Creates a new unsaved DMInheritanceRelationship where all properties are null, except ID properties
        /// and those with default values.  If there are compulsory properties without
        /// defaults, saving the object will throw an exception.
        /// </summary>
        public static DMInheritanceRelationship CreateUnsavedDefaultDMInheritanceRelationship()
        {
            DMInheritanceRelationship dMInheritanceRelationship = new DMInheritanceRelationship();
            return dMInheritanceRelationship;
        }
    }
}